<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>改变网页背景色</title>
    <script>
      function color(str) {
        document.body.style.backgroundColor = str;
      }
    </script>
  </head>
  <body>
    <input type="button" value="设为红色" onclick="color('red')">
    <input type="button" value="设为黄色" onclick="color('yellow')">
    <input type="button" value="设为蓝色" onclick="color('blue')">
    <input type="button" value="设为自定义颜色" onclick="color('#00ff00')">
    <p>
      <a href="file:///C:/Users/rise/Desktop/%E9%A6%96%E9%A1%B5/default/01.html">返回</a>
    </p>
  </body>
</html>